
#include "stdafx.h"
#include <crtdbg.h>
#include "ProgrammingPearls-01-02.h"

inline void EnableMemLeakCheck()
{
	_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
}

#ifdef _DEBUG
#define new   new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif

#include <Windows.h>

int main(int argc, char *argv[]) 
{
	EnableMemLeakCheck();
	int nResult = false;    
	int nRetCode = false;

	unsigned long ulTaskBegin = 0;
	unsigned long ulTaskEnd = 0;
	unsigned long ulTaskUseTime = 0;

	ulTaskBegin =  GetTickCount();	

	nRetCode =  BuildRandomFile( 1000000, 10000000, "Test.txt");

	ulTaskEnd =  GetTickCount();

	ulTaskUseTime = ulTaskEnd - ulTaskBegin;

	PROCESS_ERROR(nRetCode);
	nResult = true;
Exit0:
	return nResult ? 0 : 1;
}